
    public static void main(String[] args) {
        Node head = new Node("0");
        Node current=head;
        for (int i = 1; i < 10; i++) {
           Node newNode= new Node(i+"");
            current.next=newNode;
            current=newNode;
        }
        reverseListNode(head);
        System.out.println(head);
    }
    public static Node reverseListNode(Node head) {
        if (head == null || head.next == null) {
            return head;
        }

        Node preNode = null;
        Node curNode = head;
        Node nextNode ;

        while (curNode != null) {
            nextNode = curNode.next;
            curNode.next = preNode;
            preNode = curNode;
            curNode = nextNode;
        }

        return preNode;
    }